From f4f64c70a2648574376d58275e7fd8a380516c1a Mon Sep 17 00:00:00 2001 From: "djm@kirby.fc.hp.com" Date: Fri, 21 Oct 2005 13:58:39 -0600 Subject: [PATCH] Backout incautious public/io header changes --- xen/Rules.mk | 1 - xen/arch/ia64/Rules.mk | 2 +- xen/include/public/io/ioreq.h | 66 ++++++++++++++++-------------- xen/include/public/io/vmx_vlapic.h | 64 +++++++++++++++++++++++------ 4 files changed, 88 insertions(+), 45 deletions(-) diff --git a/xen/Rules.mk b/xen/Rules.mk index a1ae2c31b5..d57ca65e51 100644 --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -47,7 +47,6 @@ test-gcc-flag = $(shell $(CC) -v --help 2>&1 | grep -q " $(1) " && echo $(1)) include $(BASEDIR)/arch/$(TARGET_ARCH)/Rules.mk -CFLAGS += -D__HYPERVISOR__ ifneq ($(debug),y) CFLAGS += -DNDEBUG ifeq ($(verbose),y) diff --git a/xen/arch/ia64/Rules.mk b/xen/arch/ia64/Rules.mk index 279761d893..8eb31cc674 100644 --- a/xen/arch/ia64/Rules.mk +++ b/xen/arch/ia64/Rules.mk @@ -24,7 +24,7 @@ CFLAGS += -I$(BASEDIR)/include/asm-ia64 -I$(BASEDIR)/include/asm-ia64/linux \ -I$(BASEDIR)/include/asm-ia64/linux-null \ -I$(BASEDIR)/arch/ia64/linux -I$(BASEDIR)/arch/ia64/linux-xen CFLAGS += -Wno-pointer-arith -Wredundant-decls -CFLAGS += -DIA64 -DXEN -DLINUX_2_6 -DV_IOSAPIC_READY +CFLAGS += -DIA64 -DXEN -DLINUX_2_6 CFLAGS += -ffixed-r13 -mfixed-range=f12-f15,f32-f127 CFLAGS += -w -g ifeq ($(VALIDATE_VT),y) diff --git a/xen/include/public/io/ioreq.h b/xen/include/public/io/ioreq.h index 210810e6af..d502171bbf 100644 --- a/xen/include/public/io/ioreq.h +++ b/xen/include/public/io/ioreq.h @@ -29,18 +29,11 @@ #define STATE_IORESP_READY 3 #define STATE_IORESP_HOOK 4 -#define IOREQ_TYPE_PIO 0 /* pio */ -#define IOREQ_TYPE_COPY 1 /* mmio ops */ -#define IOREQ_TYPE_AND 2 -#define IOREQ_TYPE_OR 3 -#define IOREQ_TYPE_XOR 4 - -#ifdef __HYPERVISOR__ -#include -#else -#include -#endif - +#define IOREQ_TYPE_PIO 0 /* pio */ +#define IOREQ_TYPE_COPY 1 /* mmio ops */ +#define IOREQ_TYPE_AND 2 +#define IOREQ_TYPE_OR 3 +#define IOREQ_TYPE_XOR 4 /* * VMExit dispatcher should cooperate with instruction decoder to @@ -48,35 +41,48 @@ * virq */ typedef struct { - u64 addr; /* physical address */ - u64 size; /* size in bytes */ - u64 count; /* for rep prefixes */ + uint64_t addr; /* physical address */ + uint64_t size; /* size in bytes */ + uint64_t count; /* for rep prefixes */ union { - u64 data; /* data */ - void *pdata; /* pointer to data */ + uint64_t data; /* data */ + void *pdata; /* pointer to data */ } u; - u8 state:4; - u8 pdata_valid:1; /* if 1, use pdata above */ - u8 dir:1; /* 1=read, 0=write */ - u8 df:1; - u8 type; /* I/O type */ + uint8_t state:4; + uint8_t pdata_valid:1; /* if 1, use pdata above */ + uint8_t dir:1; /* 1=read, 0=write */ + uint8_t df:1; + uint8_t type; /* I/O type */ } ioreq_t; +#define MAX_VECTOR 256 +#define BITS_PER_BYTE 8 +#define INTR_LEN (MAX_VECTOR/(BITS_PER_BYTE * sizeof(uint64_t))) + typedef struct { - u64 pic_intr[INTR_LEN]; - u64 pic_mask[INTR_LEN]; - int eport; /* Event channel port */ + uint64_t pic_intr[INTR_LEN]; + uint64_t pic_mask[INTR_LEN]; + int eport; /* Event channel port */ } global_iodata_t; typedef struct { - ioreq_t vp_ioreq; - vl_apic_info apic_intr; + ioreq_t vp_ioreq; + unsigned long vp_intr[INTR_LEN]; } vcpu_iodata_t; typedef struct { - int vcpu_number; - global_iodata_t sp_global; - vcpu_iodata_t vcpu_iodata[1]; + global_iodata_t sp_global; + vcpu_iodata_t vcpu_iodata[1]; } shared_iopage_t; #endif /* _IOREQ_H_ */ + +/* + * Local variables: + * mode: C + * c-set-style: "BSD" + * c-basic-offset: 4 + * tab-width: 4 + * indent-tabs-mode: nil + * End: + */ diff --git a/xen/include/public/io/vmx_vlapic.h b/xen/include/public/io/vmx_vlapic.h index c765bb0cc6..5a8162b2e1 100644 --- a/xen/include/public/io/vmx_vlapic.h +++ b/xen/include/public/io/vmx_vlapic.h @@ -1,29 +1,67 @@ #ifndef _VMX_VLAPIC_H #define _VMX_VLAPIC_H +/* + We extended one bit for PIC type + */ #define VLAPIC_DELIV_MODE_FIXED 0x0 #define VLAPIC_DELIV_MODE_LPRI 0x1 #define VLAPIC_DELIV_MODE_SMI 0x2 -#define VLAPIC_DELIV_MODE_PMI 0x2 #define VLAPIC_DELIV_MODE_NMI 0x4 #define VLAPIC_DELIV_MODE_INIT 0x5 #define VLAPIC_DELIV_MODE_STARTUP 0x6 #define VLAPIC_DELIV_MODE_EXT 0x7 #define VLAPIC_DELIV_MODE_MASK 0x8 -#define MAX_VECTOR 256 -#define BITS_PER_BYTE 8 -#define INTR_LEN (MAX_VECTOR/(BITS_PER_BYTE * sizeof(u64))) -#define INTR_LEN_32 (MAX_VECTOR/(BITS_PER_BYTE * sizeof(u32))) +#define VLAPIC_MSG_LEVEL 4 + +#define INTR_EXT 0 +#define INTR_APIC 1 +#define INTR_LAPIC 2 + +#define VL_STATE_EOI 1 +#define VL_STATE_EXT_LOCK 2 +#define VL_STATE_MSG_LOCK 3 +#define VL_STATE_EOI_LOCK 3 + +#define VLOCAL_APIC_MAX_INTS 256 +#define VLAPIC_INT_COUNT (VLOCAL_APIC_MAX_INTS/(BITS_PER_BYTE * sizeof(uint64_t))) +#define VLAPIC_INT_COUNT_32 (VLOCAL_APIC_MAX_INTS/(BITS_PER_BYTE * sizeof(uint32_t))) + +struct vapic_bus_message{ + uint8_t deliv_mode:4; /* deliver mode, including fixed, LPRI, etc */ + uint8_t level:1; /* level or edge */ + uint8_t trig_mod:1; /* assert or disassert */ + uint8_t reserved:2; + uint8_t vector; +}; typedef struct { - u32 vl_lapic_id; - u32 vl_apr; - u32 vl_logical_dest; - u32 vl_dest_format; - u32 vl_arb_id; - u64 irr[INTR_LEN]; - u64 tmr[INTR_LEN]; -}vl_apic_info; + /* interrupt for PIC and ext type IOAPIC interrupt */ + uint64_t vl_ext_intr[VLAPIC_INT_COUNT]; + uint64_t vl_ext_intr_mask[VLAPIC_INT_COUNT]; + uint64_t vl_apic_intr[VLAPIC_INT_COUNT]; + uint64_t vl_apic_tmr[VLAPIC_INT_COUNT]; + uint64_t vl_eoi[VLAPIC_INT_COUNT]; + uint32_t vl_lapic_id; + uint32_t direct_intr; + uint32_t vl_apr; + uint32_t vl_logical_dest; + uint32_t vl_dest_format; + uint32_t vl_arb_id; + uint32_t vl_state; + uint32_t apic_msg_count; + struct vapic_bus_message vl_apic_msg[24]; +} vlapic_info; #endif /* _VMX_VLAPIC_H_ */ + +/* + * Local variables: + * mode: C + * c-set-style: "BSD" + * c-basic-offset: 4 + * tab-width: 4 + * indent-tabs-mode: nil + * End: + */ -- 2.30.2